package com.tuxing.draa_data.pojo.subject;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author yuanshihang
 * @since 2022-02-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("new_dc_ei_attr")
public class NewDcEiAttr implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "ID",type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 期刊ID
     */
    @TableField("RECORD_ID")
    private Long recordId;

    /**
     * 年份
     */
    @TableField("YEAR")
    private Integer year;

    /**
     * 创建人
     */
    @TableField("CREATED_BY")
    private Integer createdBy;

    /**
     * 创建时间
     */
    @TableField("CREATED_TIME")
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField("UPDATED_BY")
    private Integer updatedBy;

    /**
     * 更新时间
     */
    @TableField("UPDATED_TIME")
    private LocalDateTime updatedTime;


    public void create(Long recordId, Integer year) {
        this.recordId = recordId;
        this.year = year;
        this.createdBy = -1;
        this.createdTime = LocalDateTime.now();
        this.updatedBy = -1;
        this.updatedTime = LocalDateTime.now();
    }
}
